//
//  WCLRecordEncoder.h
//  WCL
//
//  Created by WangZhenyu on 2020/12/4.
//

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>

@class CustomRecordModel;

/**
 *  写入并编码视频的的类
 */
@interface WCLRecordEncoder : NSObject

@property (nonatomic, readonly) NSString *path;

+ (WCLRecordEncoder*)encoderForAudioPath:(NSString*)path model:(CustomRecordModel *)model;

/**
 *  完成视频录制时调用
 *
 *  @param handler 完成的回掉block
 */
- (void)finishWithCompletionHandler:(void (^)(void))handler;
/**
 *  通过这个方法写入数据
 *
 *  @param sampleBuffer 写入的数据
 *
 *  @return 写入是否成功
 */
- (BOOL)encodeFrame:(CMSampleBufferRef)sampleBuffer;

@property (nonatomic, assign) BOOL isCanWrite;
@end
